package cn.itcast.ssm.Domain.teach;

public class student extends person {
    public  double smallMoney = 20.0 ;
    private  double bigMoney   ;//封装的属性

    public double getBigMoney() {
        bigMoney = 200.0 ;
        return bigMoney;
    }
    public void eatFood(){
        System.out.println("学生吃饭,吃大餐");
    }
//封装
    public static void main(String[] args) {
//
//        student student1 = new student();
//        student student2= new student();
//        //学生1有20.0元
//        System.out.println("学生1有"+student1.smallMoney+"元");
//        //学生2拿到了学生1的20.0元
//        System.out.println("学生2拿到了学生1的"+student1.smallMoney+"元");
//        //学生1拿到了学生2的20.0元
//        System.out.println("学生1拿到了学生2的"+student2.smallMoney+"元");
//        //学生2拿不到学生1的0.0元
//        System.out.println("学生2想拿学生1的bigMoney");
//        System.out.println("学生2拿到学生1的bigMoney"+student2.bigMoney+"元");
//        System.out.println("学生1告诉学生2我将bigMoney藏起来了,你要的话通过getBigmoney来拿");
//        System.out.println("学生2拿到学生1的bigMoney"+student2.getBigMoney()+"元");
        student student = new student();
        student.eatFood();
    }
    //继承
    public  void extenDemo(){
        person person = new person();
        student student = new student();
        person.eatFood();
//        student.eatFood();
    }
    //多态
    public  void changDemo(){

    }
}
